package com.qianxun.init.properties;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

/**
 * @author: huwei
 * @date: 2019/11/13 14:52
 * @version: 1.0.0
 */
@Data
@Component
@ConfigurationProperties(prefix = "server")
public class SpringServerProperties {

    private String contextPath;

    private String servletContextPath;

    private Integer port;

    public String contextPath(){
        if(contextPath != null){
            return contextPath;
        }
        if(servletContextPath != null){
            return servletContextPath;
        }
        return "";
    }
}
